local yifen = fk.CreateSkill {
  name = "th_yifen",
  tags = { Skill.Switch, Skill.Compulsory },
}

yifen:addEffect(fk.PreCardUse, {
  anim_type = "switch",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(yifen.name) and data.card and
    (data.card.type == Card.TypeBasic or (data.card.type == Card.TypeTrick and not data.card.multiple_targets))
  end,
  on_use = function(self, event, target, player, data)
    if player:getSwitchSkillState(yifen.name, true) == fk.SwitchYang then
      data.disresponsiveList = player.room:getAlivePlayers()
    end
  end
})
yifen:addEffect("targetmod", {
  bypass_distances = function(self, player, skill, card, to)
    if player:hasSkill("th_yifen") and card and
    (card.type == Card.TypeBasic or (card.type == Card.TypeTrick and not card.multiple_targets)) then
      return player:getSwitchSkillState("th_yifen") == fk.SwitchYin
    end
  end
})

Fk:loadTranslationTable{
  ["th_yifen"] = "义忿",
  [":th_yifen"] = '转换技，锁定技，你使用基本牌或非多目标锦囊牌：<br>' ..
  '阳：不可响应；<br>' ..
  "阴：无距离限制。",

  [":th_yifen_yang"] = '转换技，锁定技，你使用基本牌或非多目标锦囊牌：<br>' ..
  '<font color=\"#E0DB2F\">阳：不可响应；</font><br>' ..
  "阴：无距离限制。",
  [":th_yifen_yin"] = '转换技，锁定技，你使用基本牌或非多目标锦囊牌：<br>' ..
  '阳：不可响应；<br>' ..
  "<font color=\"#E0DB2F\">阴：无距离限制。</font>",
}

return yifen